import request from '@/utils/request'
import apis from './'

/**
 * login func
 */
export function login (data) {
  return request({
    url: apis.Login,
    method: 'post',
    data: data
  })
}

/**
 * logout fun
 */
export function logout () {
  return request({
    url: apis.Logout,
    method: 'get'
  })
}

/**
 * login info
 */
export function getLoginInfo () {
  return request({
    url: apis.LoginInfo,
    method: 'get'
  })
}

export function sendSms (phone) {
  return request({
    url: `${apis.SmsLogin}?login_phone=${phone}`,
    method: 'get'
  })
}

export function checkSms (data) {
  return request({
    url: apis.SmsLogin,
    method: 'post',
    data: data
  })
}
